package com.hyl;

import com.dao.CheckItemDao;
import com.dao.CheckItemDaoImpl;
import com.entity.CheckItem;

import javax.annotation.Resource;
import java.util.List;
import java.util.Scanner;

/**
 * @Description TODO
 * @Author hyl
 * @Date 2022/4/18 15:00
 **/
public class Test {
	//@org.junit.Test
	public void testMenu() {
		Scanner input = new Scanner(System.in);

		do {
			System.out.println("--操作检查项目--");
			System.out.println("1、显示所有检查项目；2、新增检查项目；3、修改检查项目、4、根据编号查看检查项目");
			int type = input.nextInt();
			switch (type) {
				case 1:
					print();
					break;
				case 2:
					System.out.println("请输入新增的检查项目名称：");
					String name = input.next();
					System.out.println("请输入新增的检查项目价格：");
					double cost = input.nextDouble();
					break;
				case 3:
					break;
				case 4:
					break;
			}
		}while (1==1);
	}

	//打印
	public void print(){
		CheckItemDao dao = new CheckItemDaoImpl();
		List<CheckItem> list = dao.find();
		for (CheckItem tmp : list) {
			System.out.println(tmp.getCheckItemId() + " " + tmp.getCheckItemName() + " " + tmp.getCheckItemCost());
		}
	}


	public static void main(String[] args) {
		Test tmp = new Test();
		tmp.print();
	}
}
